home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / private / _setscrn.c < prev    next >
C/C++ Source or Header  |  1993-06-18  |  2KB  |  80 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3.  
  4. #ifdef PDCDEBUG
  5. char *rcsid__setscrn = "$Header: C:\CURSES\private\RCS\_setscrn.c 2.1 1993/06/18 20:23:49 MH Rel MH $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_set_scrn_mode()    - Set BIOS Video Mode
  14.  
  15.   PDCurses Description:
  16.      Sets the BIOS Video Mode Number ONLY if it is different from
  17.      the current video mode.  This routine is for DOS systems only.
  18.  
  19.   PDCurses Return Value:
  20.      This function returns OK on success and ERR on error.
  21.  
  22.   PDCurses Errors:
  23.      No errors are defined for this function.
  24.  
  25.   Portability:
  26.      PDCurses    int PDC_set_scrn_mode( int new_mode );
  27.  
  28. **man-end**********************************************************************/
  29.  
  30. #ifdef     OS2
  31. int    PDC_set_scrn_mode(VIOMODEINFO new_mode)
  32. #else
  33. int    PDC_set_scrn_mode(int new_mode)
  34. #endif
  35. {
  36. #ifdef    DOS
  37.     int    cur;
  38. #endif
  39.  
  40. #ifdef PDCDEBUG
  41.     if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n");
  42. #endif
  43.  
  44. #ifdef    FLEXOS
  45.     return( OK );
  46. #endif
  47.  
  48. #ifdef    DOS
  49.     cur = (int) PDC_get_scrn_mode();
  50.     if (cur != new_mode)
  51.     {
  52.         regs.h.ah = 0x00;
  53.         regs.h.al = (char) new_mode;
  54.         int86(0x10, ®s, ®s);
  55.     }
  56.     _cursvar.font = PDC_get_font();
  57.     _cursvar.scrnmode = new_mode;
  58.     LINES = PDC_get_rows();
  59.     COLS = PDC_get_columns();
  60.     return( OK );
  61. #endif
  62.  
  63. #ifdef    OS2
  64.     if (VioSetMode (&new_mode, 0) != 0)
  65.         {
  66.         _cursvar.font = PDC_get_font();
  67.         _cursvar.scrnmode = new_mode;
  68.         LINES = PDC_get_rows();
  69.         COLS = PDC_get_columns();
  70.         return( OK );
  71.         }
  72.     else
  73.         return (ERR);
  74. #endif
  75.  
  76. #ifdef UNIX
  77.     return(OK); /* this is N/A */
  78. #endif
  79. }
  80.